﻿using FictionsDownload.DAL;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FictionsDownload.Model
{
    [Table("Directory")]
    public class DirectoryModel:BaseModel
    {
        public DirectoryModel():base()
        {
            State = true;
            Read = false;
        }
        [Display(Name = "章节名称")]
        public string Name { get; set; }
        public string Url { get; set; }
        public string Text { get; set; }
        public int? Len { get; set; }
        [Display(Name="是否显示")]
        public bool State { get; set; }
        [Display(Name = "是否阅读")]
        public bool? Read { get; set; }
        [Display(Name = "创建时间")]
        public string BookId { get; set; }
        public virtual BookModel Book { get; set; }
        public void Delete(IDAL db)
        {
            db.Delete(this);
        }
    }
}
